package com.io;

import java.io.FileOutputStream;
import java.io.IOException;

class test {  // 类名首字母应大写
    public static void main(String[] args) {
        String data = "laodongjie213413";
        // 使用try-with-resources自动关闭流
        try (FileOutputStream fileOutputStream = new FileOutputStream("1.html")) {
            byte[] bytes = data.getBytes();
            fileOutputStream.write(bytes);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}